Skip to content

Surface: Add thermal sensors and fan speed for Pro 8, Laptop 4 (Intel) and Pro 7+ - #213

Open
larsschellhas wants to merge 3 commits into
linux-surface:v7.3-surface-develfrom
larsschellhas:surface-sensor-nodes
Open

larsschellhas wants to merge 3 commits into
linux-surface:v7.3-surface-develfrom
larsschellhas:surface-sensor-nodes

Conversation

@larsschellhas

Copy link
Copy Markdown
Contributor

The EC of the Surface Pro 8, the Surface Laptop 4 (Intel) and the Surface Pro 7+ answers the same thermal sensor (TMP, function 2) and fan speed (FAN, instance 1) requests as the devices that already list the nodes (Surface Book 3 since #190, Pro 9/10/11, Laptop 5/6, Studio 2). The registry groups of these three devices don't include them, so surface_temp and surface_fan never bind. The sensors are wanted by a user-space implementation of the Windows power management (linux-surface/linux-surface#2383), which reads two of them as inputs and so far has no kernel source for them on these devices.

This PR has three commits, one per device, so that each can be taken or dropped on its own:

  1. Surface Pro 8: ssam_node_group_sp8 gets ssam_node_tmp_sensors and ssam_node_fan_speed. The group serves only MSHW0263.
  2. Surface Laptop 4 (Intel): a group of its own for MSHW0250, ssam_node_group_sl4: every node of ssam_node_group_sl3_dptf plus the two new ones. MSHW0110 (Laptop 3 and 4, 15", AMD) stays on sl3_dptf unchanged.
  3. Surface Pro 7+: ssam_node_group_sp7_dptf (only MSHW0119) gets both nodes.

No has_fan and no other property is added; the platform profile nodes are unchanged.

Surface Laptop 4 models. No model loses a node; a model on MSHW0250 gains the two nodes:

Model ACPI ID Group after this PR Source of the ID
13.5", Intel MSHW0250 new sl4 registry since 2021; the Windows driver package for the Intel models (26.091.11858.0, configuration for 13.5" and 15") binds its integration driver to ACPI\MSHW0250 only
15", Intel MSHW0250 new sl4 measured (below); it was not named in the comments before
15", AMD MSHW0110 sl3_dptf, unchanged registry since 2021
13.5", AMD not known – no registry entry names it. If it is MSHW0110, nothing changes; if it is MSHW0250, it gets the nodes without a measurement

Evidence. The three devices were not run with these patches. Their owners ran a read-only probe that sends the requests surface_temp and surface_fan send (TMP 0x04, 0x0e, 0x01 on the SAM target, instance 0; FAN 0x01, instance 1) through the SSAM debug device and recorded the raw answers. The reports are linked in the commits.

Device SKU, CPU Kernel Sensor mask Sensors Fan
Surface Pro 8 Surface_Pro_8_1983, i7-1185G7 7.3.6-1-surface 0x07ff 1–11, I_RTS1–I_RTS8, I_VTS1–I_VTS3 0 rpm idle, about 3000 rpm under load
Surface Laptop 4 (15", Intel) Surface_Laptop_4_1978:1979, i7-1185G7 7.2.15-4-omarchy 0x07f6 2, 3, 5–11 about 4900 rpm, up to about 7900 rpm under load
Surface Pro 7+ Surface_Pro_7+_1960, i7-1165G7 7.3.6-arch1-1-surface (fan also 7.3.4-arch1-2-surface) 0x0fff 1–12, I_RTS1–I_RTS8, I_VTS1–I_VTS4 0 rpm idle, 3614 rpm in an earlier run
  • On the Pro 8 (two runs) and the Laptop 4, the temperatures followed a 150 s CPU load (for example Pro 8 sensor 1: 36 → 56 °C, Laptop 4 sensor 2: 47 → 60 °C).
  • On the Pro 7+ the temperatures were read once, at idle (28.5–38.4 °C).
  • On the Laptop 4 the mask has no sensors 1 and 4; surface_temp only shows sensors in the mask.

Open points, so that nobody has to guess:

  • Not measured: the LTE model of the Pro 8, the 13.5" Laptop 4 (Intel), the 13.5" Laptop 4 (AMD, ACPI ID unknown, see above) and Pro 7+ models other than the one above. The LTE Pro 8 is probably on the same ACPI ID; the Windows driver package has one SAM firmware image for the Pro 8 Wi-Fi and LTE models and one for the Laptop 4 (Intel) 13.5" and 15". That suggests the same interfaces, but it is not a measurement.
  • Pro 7+ fan: only a model with a fan was measured. Whether Pro 7+ models without a fan exist under MSHW0119, and what the fan request returns there, is not known to me. surface_fan sends no request at probe, so such a model would get a fan1_input whose read fails. This follows Surface Book 3: Add thermal sensors and fans (main and base) #190, where the Surface Book 3 group (MSHW0117, 13.5" and 15") got the nodes with only the 15" measured. If someone reports a failing read, the node can be restricted.
  • Not tested with the patches: only the requests were measured, not the binding of the drivers to the new nodes.
  • Checks: checkpatch.pl --strict reports no errors, warnings or checks for the three patches. The file builds with W=1 and no warnings at each of the three commits (out of tree, against the headers of 7.3.6-1-surface).
  • Other PRs: platform/surface: aggregator_registry: Add thermal sensors and fan speed for Surface Laptop Go #198 (Laptop Go, group slg1) and hwmon: surface_temp: Expose sensor 9 offset via HWMON_T_OFFSET #212 (surface_temp and, in this file, the Laptop Go groups and a tmp_sensors_with_offset node) don't touch the groups changed here. I compared the hunks by reading them; a trial merge was not completed, so a rebase may still need a look.

The analysis, the patches and the changelogs were prepared with the help of an AI coding assistant (Claude, Anthropic). I reviewed the changes. I did not run them on the devices: the readings come from the testers' reports.

…eed for Surface Pro 8

The Surface Pro 8 EC provides the same thermal sensor (TMP, function 2)
and fan speed (FAN, instance 1) interfaces as the newer devices that
already list them, but the Surface Pro 8 node group does not include
them. Add both nodes so that surface_temp and surface_fan can bind.

The group is used only for the ACPI ID MSHW0263, so no other device
gets the nodes. The platform profile node stays as it is, without the
has_fan property.

Evidence: a Surface Pro 8 (SKU Surface_Pro_8_1983, i7-1185G7, with the
Wi-Fi variant of the Windows power management configuration, kernel
7.3.6-1-surface) answered the read requests that the two drivers
send. They were sent through the SSAM debug device because the kernel
had no nodes for the device, in two runs a quarter of an hour apart:

  - TMP 0x04 (available sensors), SAM target: mask 0x07ff, i.e. the
    sensors 1 to 11.
  - TMP 0x0e (name) for each of them: I_RTS1 to I_RTS8 and I_VTS1 to
    I_VTS3, in the layout that surface_temp expects.
  - TMP 0x01 (temperature) for each of them: 31 to 39 degrees C at idle.
    During a CPU load of 150 s the readings rose (sensor 1 from 36 to
    56 degrees C) and fell again afterwards.
  - FAN 0x01, instance 1: 0 rpm at idle, about 3000 rpm under the same
    load.

Not tested: no device has run a kernel with this patch, so the binding
of surface_temp and surface_fan to the nodes was not observed on a
Surface Pro 8. The LTE model is probably served by the same group, so it
would get the nodes too. Neither its ACPI ID nor its EC was measured.
The Windows driver package has one SAM firmware image for the Wi-Fi and
the LTE model, which suggests the same interfaces, but that is not a
measurement.

The analysis, the patch and this changelog were prepared with the help
of an AI coding assistant (Claude, Anthropic). The evidence is the
tester's report; I did not test on a Surface Pro 8 myself. I reviewed
the change.

Link: larsschellhas/linux-surface-power#4 (comment)
Link: larsschellhas/linux-surface-power#4 (comment)
Assisted-by: LLM checkpatch
Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
…eed for Surface Laptop 4 (Intel)

The Surface Laptop 4 (Intel) EC provides the same thermal sensor (TMP,
function 2) and fan speed (FAN, instance 1) interfaces as the newer
devices that already list them, but its node group does not include
them. Add both nodes so that surface_temp and surface_fan can bind.

The Intel models use the ACPI ID MSHW0250, which shared
ssam_node_group_sl3_dptf with MSHW0110 (Surface Laptop 3 and 4, 15",
AMD). Give MSHW0250 a group of its own: it has every node of
ssam_node_group_sl3_dptf plus the two new ones. MSHW0110 keeps its
group unchanged. Update the comments of the group and of the ID list.

The Surface Laptop 4 models and where they end up:

  13.5", Intel  MSHW0250  new group  ID: registry entry since 2021, and
                                      the Windows driver package (below)
  15", Intel    MSHW0250  new group  ID and readings measured (below)
  15", AMD      MSHW0110  unchanged  ID: registry entry since 2021
  13.5", AMD    not known            no registry entry names it

No model loses a node: a model on MSHW0250 gains the two nodes, a model
on MSHW0110 keeps what it had. The 15" Intel model was not named in
the comments before; it reports MSHW0250, so the ID list now names it.
The ACPI ID of the 13.5" AMD model is not known to me. If it is
MSHW0110, nothing changes for it. If it is MSHW0250, it gets the two
nodes without a measurement.

The Windows driver package for the Surface Laptop 4 with Intel processor
(26.091.11858.0) carries the power management configuration for the
13.5" and the 15" model. Its integration driver binds to ACPI\MSHW0250,
and to no other ID.

Evidence: a Surface Laptop 4 (15", Intel, SKU Surface_Laptop_4_1978:1979,
i7-1185G7, ACPI ID MSHW0250, kernel 7.2.15-4-omarchy, which has no nodes
for the device) answered the read requests that the two drivers send.
They were sent through the SSAM debug device:

  - TMP 0x04 (available sensors), SAM target: mask 0x07f6, i.e. the
    sensors 2, 3 and 5 to 11. surface_temp makes only the sensors in
    the mask visible.
  - TMP 0x0e (name) for each of them: I_RTS2, I_RTS3, I_RTS5 to I_RTS8
    and I_VTS1 to I_VTS3, in the layout that surface_temp expects.
  - TMP 0x01 (temperature) for each of them: 31 to 47 degrees C when the
    run started. During a CPU load of 150 s the readings rose (sensor 2
    from 47 to 60 degrees C).
  - FAN 0x01, instance 1: about 4900 rpm when the run started and up
    to about 7900 rpm under the load.

Not tested: no device has run a kernel with this patch, so the binding
of surface_temp and surface_fan to the nodes was not observed. Only the
15" Intel model was measured. The driver package has one SAM firmware
image for both sizes, which suggests the same interfaces on the 13.5"
model, but that is not a measurement.

The analysis, the patch and this changelog were prepared with the help
of an AI coding assistant (Claude, Anthropic). The evidence is the
tester's report; I did not test on a Surface Laptop 4 myself. I
reviewed the change.

Link: larsschellhas/linux-surface-power#6
Assisted-by: LLM checkpatch
Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
…eed for Surface Pro 7+

The Surface Pro 7+ EC provides the same thermal sensor (TMP, function 2)
and fan speed (FAN, instance 1) interfaces as the newer devices that
already list them, but the Surface Pro 7+ node group does not include
them. Add both nodes so that surface_temp and surface_fan can bind.

The group is used only for the ACPI ID MSHW0119, so no other device
gets the nodes. The platform profile node stays as it is, without the
has_fan property.

Evidence: a Surface Pro 7+ (SKU Surface_Pro_7+_1960, i7-1165G7, ACPI ID
MSHW0119) answered the read requests that the two drivers send. They
were sent through the SSAM debug device because the kernel had no nodes
for the device:

  - TMP 0x04 (available sensors), SAM target: mask 0x0fff, i.e. the
    sensors 1 to 12. surface_temp supports up to 16.
  - TMP 0x0e (name) for each of them: I_RTS1 to I_RTS8 and I_VTS1 to
    I_VTS4, in the layout that surface_temp expects.
  - TMP 0x01 (temperature) for each of them: 28.5 to 38.4 degrees C at
    idle (kernel 7.3.6-arch1-1-surface).
  - FAN 0x01, instance 1: 0 rpm at idle in the same run, and 3614 rpm in
    an earlier run on the same device (kernel 7.3.4-arch1-2-surface).

Not tested: the temperatures were read once, at idle, without a load
run, so it was not observed that they follow the load. No device has
run a kernel with this patch, so the binding of surface_temp and
surface_fan to the nodes was not observed. Only this one device, a
model with a fan, was measured. Whether Surface Pro 7+ models without
a fan exist under the same ACPI ID, and what the fan request returns
there, is not known. If such a model does not answer, reading fan1_input
fails there; the node can then be restricted.

The analysis, the patch and this changelog were prepared with the help
of an AI coding assistant (Claude, Anthropic). The evidence is the
tester's reports; I did not test on a Surface Pro 7+ myself. I reviewed
the change.

Link: larsschellhas/linux-surface-power#2
Link: larsschellhas/linux-surface-power#2 (comment)
Assisted-by: LLM checkpatch
Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
@larsschellhas

Copy link
Copy Markdown
Contributor Author

Two things about the Surface Pro 8 that I found after opening this PR, and that belong here:

  • A mainline patch with the same change already exists. Emfox Zhou sent the same two lines for ssam_node_group_sp8 to mainline on 20 Nov 2026 (LKML), tested on a Pro 8 (i7-1185G7) with eleven sensors and a fan reading of 4592 rpm. I missed it when I wrote commit 1, and it should have been credited there.
  • The nodes have already run on a Pro 8. mfeineis reports in Track missing SSAM temperature and fan-speed devices across Surface models linux-surface#2427 (comment) that a Pro 8 Wi-Fi (SKU Surface_Pro_8_1983, MSHW0263, SAM 12.100.139) has run a kernel with both nodes for a couple of weeks, and that surface_fan and surface_thermal with all eleven sensors appear. That covers the "not tested" point of commit 1 for the Wi-Fi model.

How would you like to handle the Pro 8? I can drop commit 1 from this PR, so that the Pro 8 comes with Emfox's patch, or keep it and add a Link: to the mainline patch. The Laptop 4 (Intel) and Pro 7+ commits don't depend on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant